<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">

<!-- BEGIN HEAD -->

<head>

<meta charset="utf-8" />

<title>编辑员工</title>

<meta content="width=device-width, initial-scale=1.0" name="viewport" />
<meta content="" name="description" />
<meta th:content="${session.authorities}" id="authority" />

<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link href="/media/css/bootstrap.min.css" rel="stylesheet"
	type="text/css" />
<link href="/media/css/bootstrap-responsive.min.css" rel="stylesheet"
	type="text/css" />
<link href="/media/css/font-awesome.min.css" rel="stylesheet"
	type="text/css" />
<link href="/media/css/style-metro.css" rel="stylesheet" type="text/css" />
<link href="/media/css/style.css" rel="stylesheet" type="text/css" />
<link href="/media/css/style-responsive.css" rel="stylesheet"
	type="text/css" />

<link rel="stylesheet" type="text/css" href="/media/css/datepicker.css" />

<link rel="stylesheet"
	href="/media/ztree/css/bootstrapStyle/bootstrapStyle.css"
	type="text/css">
<link rel="shortcut icon" href="/media/image/favicon.ico" />

<style>
.permission {
	display: inline-block;
}

.permission a {
	text-decoration: none;
}
</style>
</head>

<!-- END HEAD -->

<!-- BEGIN BODY -->

<body>
	<div class="page-content" style="margin: 0 50px;">

		<div class="row-fluid">
			<div class="span12" style="padding: 5px 10px;">
				<!-- BEGIN FORM-->
				<form class="form-horizontal" id="staff_edit_form">
					<div class="row-fluid">
						<div class="span6">
							<div class="control-group">
								<label class="control-label">系统账号:</label>
								<div class="controls">
									<input type="text" class="m-wrap span7" name="userName" required th:value="${currentUser.userName}" disabled><span
										class="help-inline" style="color: red;">*登录系统使用</span>
								</div>
							</div>
						</div>
						<!--/span-->
						<div class="span5">
							<div class="control-group">
								<label class="control-label">Email:</label>
								<div class="controls">
									<input type="text" class="m-wrap span7" name="staffEmail" required th:value="${staff.staffEmail}">
									<span class="help-inline" style="color: red;">*</span>
								</div>
							</div>
						</div>
					</div>
					<!--/row-->
					<div class="row-fluid">
						<div class="span6">
							<div class="control-group">
								<label class="control-label">真实姓名:</label>
								<div class="controls">
									<input type="text" class="m-wrap span7" name="staffRealName" required th:value="${staff.staffRealName}"><span
										class="help-inline" style="color: red;">*</span>
								</div>
							</div>
						</div>
						<div class="span4">
							<div class="control-group">
								<label class="control-label">状态:</label>
								<div class="controls">
									<select class="m-wrap span10" name="staffState">
										<option value="0" >请选择</option>
										<option value="1" th:selected="${staff.staffState} eq 1">在职</option>
										<option value="5" th:selected="${staff.staffState} eq 5">离职</option>
										<option value="2" th:selected="${staff.staffState} eq 2">兼职</option>
										<option value="3" th:selected="${staff.staffState} eq 3">实习</option>
										<option value="4" th:selected="${staff.staffState} eq 4">冻结</option>
									</select>
								</div>
							</div>
						</div>


						<!--/span-->
					</div>
					<div class="row-fluid">
						<div class="span6">
							<div class="control-group">
								<label class="control-label">手机号码:</label>
								<div class="controls">
									<input type="text" class="m-wrap span7" name="staffPhone" required th:value="${staff.staffPhone}">
									<span class="help-inline" style="color: red;">*</span>
								</div>

							</div>
						</div>
						<div class="span4">
							<div class="control-group">
								<label class="control-label">入职时间:</label>
								<div class="controls">
									<div class="input-append date date-picker"
										data-date-format="yyyy-mm-dd" data-date-viewmode="years">
										<input class="m-wrap m-ctrl-medium date-picker" readonly=""
											size="16" type="text" value="" name="staffJoinTime" th:value="${staff.staffJoinTime != null} ?${#calendars.format(staff.staffJoinTime,'yyyy-MM-dd')}:2017-4-28" ><span
											class="add-on"><i class="icon-calendar"></i></span>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="row-fluid">
						<div class="span6">
							<div class="control-group">
								<label class="control-label">所属部门:</label>
								<div class="controls">
									<select class="m-wrap span7" name="staffDepartment">
										<option value="0">请选择</option>
										<option value="1" th:each="dept:${departments}"
											th:value="${dept.id}" th:text="${dept.deptName}" th:selected="${staff.staffDepartment} eq ${dept.id}">市场部</option>

									</select>
								</div>
							</div>
						</div>
						<div class="span4">
							<div class="control-group">
								<label class="control-label">QQ:</label>
								<div class="controls">
									<input type="text" class="m-wrap span10" name="staffQq" th:value="${staff.staffQq}">

								</div>

							</div>
						</div>
					</div>
					<div class="row-fluid">
						<div class="span6">
							<div class="control-group">
								<label class="control-label">员工岗位:</label>
								<div class="controls">
									<select class="m-wrap span7" name="staffPosition">
										<option value="0">请选择</option>
										<option value="2" th:each="position:${positions}"
											th:value="${position.id}" th:text="${position.positionName}" th:selected="${staff.staffPosition} eq ${position.id}">离职</option>
									</select>
								</div>
							</div>
						</div>
						<div class="span6">
							<div class="control-group">

								<div class="controls">

									<label class="checkbox">

										<div class="checker">
											<span><input type="checkbox" value="1" name="isAdviser" th:checked="${staff.isAdviser} eq 1"></span>
										</div>是否顾问

									</label> <label class="checkbox">

										<div class="checker">
											<span><input type="checkbox" value="1"
												style="margin-left: -14px;" name="isTeacher" th:checked="${staff.isTeacher} eq 1"></span>
										</div>是否老师

									</label> <label class="checkbox">

										<div class="checker">
											<span><input type="checkbox" value="1"
												style="margin-left: -14px;" name="isMarketPerson" th:checked="${staff.isMarketPerson} eq 1"></span>
										</div>是否市场人员

									</label>

								</div>
							</div>
						</div>
					</div>
					<hr>
					<div class="row-fluid">
						<div class="span12">
							<div class="control-group">
								<label class="control-label">员工权限:</label>
								<div class="controls">
									<div class="permission" th:each="role:${roles}">
										<input type="radio" value="" th:value="${role.id}"
											name="staffPermission" th:checked="${role.id} eq ${staff.staffPermission}"> <a th:text="${role.roleName}" th:attr="data-id=${role.id}" >老师</a>
									</div>
								</div>
							</div>
						</div>
					</div>
					<hr>
					<div class="row-fluid" id="has_student">
						<div class="span12">
							<div class="control-group">
								<label class="control-label">拥有学员:</label>
								<div class="controls">
									<div class="row-fluid">
										<div class="permission">
											<span>潜在学员：</span>
										</div>
										<div class="permission" th:each="m:${valid}">
											<input type="checkbox" th:value="${m.id}" th:checked="${staff.hasStudent}!=null?${#lists.contains(#strings.listSplit(staff.hasStudent,','),m.id+'')}" name="hasStudent"> <span
												th:text="${m.stateParam}">老客户</span>
										</div>

									</div>
									<div class="row-fluid">
										<div class="permission">
											<span>无效学员：</span>
										</div>
										<div class="permission" th:each="m:${invalid}">
											<input type="checkbox" th:value="${m.id}" th:checked="${staff.hasStudent}!=null?${#lists.contains(#strings.listSplit(staff.hasStudent,','),m.id+'')}" name="hasStudent"> <span
												th:text="${m.stateParam}" >老客户</span>
										</div>
									</div>
									<div class="row-fluid">
										<div class="permission">
											<span>会 员：</span>
										</div>
										<div class="permission" th:each="m:${member}">
											<input type="checkbox" th:value="${m.id}" th:checked="${staff.hasStudent}!=null?${#lists.contains(#strings.listSplit(staff.hasStudent,','),m.id+'')}" name="hasStudent"> <span
												th:text="${m.stateParam}" >老客户</span>
										</div>
									</div>

								</div>
							</div>
						</div>
					</div>
					<hr>
					<div class="row-fluid">
						<div class="span12">
							<div class="control-group">
								<label class="control-label">备注信息</label>
								<div class="controls">
									<textarea class="span6 m-wrap" rows="5" name="staffRemark" th:text="${staff.staffRemark}"></textarea>
								</div>
							</div>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!-- 		权限树的弹框 -->
		<div class="row-fluid" style="display: none;" id="per_tree">
			<div calss="span6 text-center">
				<ul id="treeEdit" class="ztree"></ul>
			</div>
		</div>
	</div>



	<!-- BEGIN CORE PLUGINS -->
	<script src="/media/js/jquery-1.10.1.min.js" type="text/javascript"></script>
	<script src="/media/js/jquery-migrate-1.2.1.min.js"
		type="text/javascript"></script>
	<script src="/media/js/bootstrap.min.js" type="text/javascript"></script>

	<script type="text/javascript"
		src="/media/ztree/js/jquery.ztree.core.js"></script>
	<script type="text/javascript"
		src="/media/ztree/js/jquery.ztree.excheck.js"></script>
	<script type="text/javascript" src="/media/js/jquery.validate.min.js"></script>
	<script type="text/javascript" src="/media/layer/layer.js"></script>

	<script src="/media/js/app.js"></script>

	<script type="text/javascript" src="/media/js/bootstrap-datepicker.js"></script>
	<script type="text/javascript"
		src="/media/js/bootstrap-datepicker.zh-CN.js"></script>
	<script src="/media/js/staffedit.js"></script>


	<script>
		jQuery(document).ready(function() {
			App.init();
			StaffEdit.init();
		});
	</script>

	<!-- END JAVASCRIPTS -->
</body>

<!-- END BODY -->

</html>